import request from '@/utils/request'

//商品分类
/**
 * 获取分类
 * @param {page,limit,keywords} data 
 * @returns 
 */

export function commodityCategoryList(data) {
    return request({
        url: '/admin/goods/goodsclass/goodsClassList',
        method: 'post',
        data
    })
}

export function deleteCategoryList(data) {
    return request({
        url: '/admin/goods/goodsclass/delGoodsClass',
        method: 'post',
        data
    })
}

export function addCategoryList(data) {
    return request({
        url: '/admin/goods/goodsclass/addGoodsClass',
        method: 'post',
        data
    })
}

export function editCategoryList(data) {
    return request({
        url: '/admin/goods/goodsclass/editGoodsClass',
        method: 'post',
        data
    })
}

// 商品管理
/**
 * 获取商品
 * @param {page,limit,keywords,class_id} data 
 * @returns 
 */

export function commodityMangeList(data) {
    return request({
        url: '/admin/goods/goods/goodsList',
        method: 'post',
        data
    })
}

export function deleteMangeList(data) {
    return request({
        url: '/admin/goods/goods/delGoods',
        method: 'post',
        data
    })
}

export function addMangeList(data) {
    return request({
        url: '/admin/goods/goods/addGoods',
        method: 'post',
        data
    })
}

export function editeMangeList(data) {
    return request({
        url: '/admin/goods/goods/editGoods',
        method: 'post',
        data
    })
}

// 商品订单
/**订单商品
 * @param {page,limit,keywords,status,add_time} data 
 * @returns 
 */

export function commodityOrderList(data) {
    return request({
        url: '/admin/order/orderList',
        method: 'post',
        data
    })
}

export function spliceOrder(data) {
    return request({
        url: '/admin/order/splitOrder',
        method: 'post',
        data
    })
}

export function getDeliveryCompony(data) {
    return request({
        url: '/admin/order/getExpress',
        method: 'post',
        data
    })
}

export function delivery(data) {
    return request({
        url: '/admin/order/goDrive',
        method: 'post',
        data
    })
}

export function getOrderDetail(data) {
    return request({
        url: '/admin/order/orderDetails',
        method: 'post',
        data
    })
}

export function snToCompany(data) {
    return request({
        url: '/admin/delivery/getExpressCompany',
        method: 'post',
        data
    })
}
export function backOrder(data) {
    return request({
        url: '/admin/order/backOrder',
        method: 'post',
        data
    })
}